package com.dxy.df.core.exception;


import com.dxy.df.constants.ConstNumbers;
import com.dxy.df.constants.ErrorEnum;

public class BizException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    private String msg;
    private int code = ConstNumbers.DEFAULT_ERROR_CODE;

    public BizException(String msg) {
        super(msg);
        this.msg = msg;
    }


    public BizException(int code,String msg ) {
        super(msg);
        this.msg = msg;
        this.code = code;
    }

    public BizException(ErrorEnum errorEnum) {
        super(errorEnum.getMsg());
        this.msg = errorEnum.getMsg();
        this.code = errorEnum.getCode();
    }

    public BizException(String msg, int code, Throwable e) {
        super(msg, e);
        this.msg = msg;
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
    
}
